Triangles

The robot uses a triangle to figure out which direction the it is traveling. We have layed out a triangle of IR LEDs in an isosceles triangle. The triangle has one side that is much shorter than the others so that we can figure out which direction the robot is pointing. First we find out which side of the triangle is the shortest side by passing the points over to the distance function included in the shell. Once we have decided which 2 points are included in the short side of the triangle we use the point that is not on that side to indicate direction.

trianglerobot.gif